Learn R Programming

HAC (version 0.1-1)

dAC, dHAC: Probability density function

Description

The function dHAC returns the values of the pdf for 3-dimensional HAC, whereas the function dAC returns the values of a pdf for 2-dim AC.

Usage

dHAC(X, hac)
dAC(x, y, theta = 1.0, type = AC_GUMBEL)

Arguments

hac
an object of the class hac.
theta
the dependency parameter of the copula.
type
choose between AC_GUMBEL, AC_CLAYTON and GAUSS.
X
a data matrix. The number of columns ($2$ or $3$) has to coincide with the dimension of the corresponding copula model. X has to contain at least to rows (observations), because the values of the pdf cannot be computed else. The column names
x, y
data vectors.

Value

  • A vector containing the values of the pdf.

Details

To do: extending the dimension of dHAC.

References

Savu, C. and Trede, M. 2010, Hierarchies of Archimedean copulas, Quantitative Finance 10, 295-304.

See Also

pHAC

Examples

Run this code
# AC example
# the underlying model
g.model = hac(type = AC_GUMBEL, X = 1.5, dim = 2)

# sample from copula g.model
sample = rHAC(100, g.model)

# returns the pdf at each point of the sample
values_1 = dHAC(sample, g.model)
values_2 = dAC(sample[, 1], sample[, 2], theta = 1.5, type = AC_GUMBEL)
round(values_1) == round(values_2) # TRUE


# HAC example
# the underlying model
y = c(~X1, ~X2, ~X3)
theta = c(1.5, 3)
g.model = hac.full(type = HAC_GUMBEL, y, theta)

# sample from copula g.model
sample = rHAC(100, g.model)

# returns the pdf at each point of the sample
values = dHAC(sample, g.model)

Run the code above in your browser using DataLab